package com.design.pool;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Test {

    public static void main(String[] args) throws SQLException {
        ConnectionPool pool= new ConnectionPool();
        Connection connection = pool.getConnection();
        System.out.println(connection);
        Statement statement = connection.createStatement();
        String sql = "select * from t_legal_person_base limit 0,10";
        ResultSet rs = statement.executeQuery(sql);
        while (rs.next()) {
            String legal_id = rs.getString("legal_id");
            String org_name = rs.getString("org_name");
            System.out.println(legal_id+" | "+org_name);
        }
        rs.close();
        pool.release(connection);
        System.out.println();

    }
}
